require 'rubygems'
require 'hpricot'
class Hpricot::Doc
  def links
    self/"a"
  end
end

class Hpricot::Elem
  def href
    #only for link
    assert self.etag.inspect.downcase == "</a>"

    return self[:href]
  end
  def title
    #puts self
    #begin
      result = self.inner_html #todo, find out a way to extract inner_text
      #puts "," + result

    #rescue
    #  ""
    #end
    result
  end
end